<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researchsubject.domain.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.page.PageUtil,com.hs.core.utils.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String imagePath = path + "/index/";
List resultList = (List)request.getAttribute("resultList"); 
List nameList = (List)request.getAttribute("nameList"); 
List levelList = (List)request.getAttribute("levelList"); 
List gradeList = (List)request.getAttribute("gradeList"); 
String achId = (String)request.getAttribute("achId"); 
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><%=Constants.APP_TITLE %>--成果获奖信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=path%>/index/Themes/com/style.css" rel="stylesheet" type="text/css" /> 
    <script src="<%=path%>/index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=path%>/js/common.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script> 
    <script type="text/javascript">
    function addCup(){
         var achId = '<%=achId%>';
         var resultType = dwr.util.getValue("resultType");
         var resultLevel = dwr.util.getValue("resultLevel");
         var resultGrade = dwr.util.getValue("resultGrade");
         var belongyear = dwr.util.getValue("belongyear");
         if(isNull(resultType)){
           alert("请选择获奖类型");
           document.getElementById("resultType").focus();
           return;
         }
         if(isNull(resultLevel)){
           alert("请选择获奖等级");
           document.getElementById("resultLevel").focus();
           return;
         }
         if(isNull(resultGrade)){
           alert("请选择获奖级别");
           document.getElementById("resultGrade").focus();
           return;
         }
         if(isNull(belongyear)){
           alert("请选择获奖年份");
           document.getElementById("belongyear").focus();
           return;
         }
         subject.addCup(achId,resultType,resultLevel,resultGrade,belongyear,addCallBack);
     
    }
    function addCallBack(message){
       alert(message);
       document.location.replace(document.location.href);
    }
    function delFund(id){
       if(confirm("确认要删除该成果获奖信息吗？")){
          subject.delCup(id,delCallBack);
       }
    
    }
    function delCallBack(message){
       alert(message);
       document.location.replace(document.location.href);
    }
    
    </script>
  </head>
  
  <body class="rtm_body">
  <form name="form1">
    <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <span>
                <img src="<%=imagePath%>Themes/com/idt_tb_pass.gif" />&nbsp;&nbsp;已获奖信息</span>
        </div>
    </div> 
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <div class="content">
                    <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4">
                        <tr>
                             
                            <td class="dg_headerstyle" align="center"  width="5%">
                                 序号</td>
                            <td class="dg_headerstyle">
                                 获奖类型</td>
                            <td class="dg_headerstyle">
                                获奖等级</td>
                            <td class="dg_headerstyle">
                                获奖级别</td>
                                 <td class="dg_headerstyle">
                                获奖年份</td> 
                                <td class="dg_headerstyle">
                                删除</td> 
                        </tr>
                        <%
                          
                          if(null != resultList && resultList.size()> 0){
                        	  for(int i = 0;i<resultList.size();i++){
                        		   Map m = (Map)resultList.get(i);
                          
                        %>
                        <tr class="dg_alternatingitemstyle">
                             
                            <td align="center" width="5%">
                                <%=i+1%></td>
                            <td align="center">
                                  <%=StringUtilTool.NULL2Blank(m.get("PRIZENAME")+"") %>
                            </td>
                            <td>
                                 <%=StringUtilTool.NULL2Blank(m.get("GRADE")+"") %>
                            </td>
                            <td>
                                 <%=StringUtilTool.NULL2Blank(m.get("LEVELS")+"") %>
                            </td>
                            <td>
                                 <%=StringUtilTool.NULL2Blank(m.get("YEAR")+"") %>
                            </td>  
                            <td align="center">
                                <img src="<%=imagePath %>Themes/com/68design.net_registration1_(delete)_16x16.gif" onclick="javascript:delFund('<%=m.get("ID") %>');"
                                    alt="删除" />
                            </td> 
                        </tr> 
                        <%}}else{ %>
                         <tr class="dg_alternatingitemstyle"> 
                            <td colspan="6" align="center">
                                <font color=red>没有找到记录</font>
                            </td>  
                        </tr>  
                        <%} %>
                    </table>  
                </div>
            </td>
        </tr>
    </table>
    
    <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">  
        <tr>
            <td valign="top" height="100%">
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                    <tr>
                        <td valign="top" >
                            <!------------------ 标题栏 ------------------>
                            <!--- 标题 ---->
                            <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                <tr >
                                    <td class="idt_tle_i">
                                        <img id="imgForm6" src="<%=basePath%>index/Themes/com/idt_tle_o.gif"></td>
                                    <td class="idt_tle_f1">
                                        添加获奖信息</td>
                                </tr>
                            </table>
                            <!--- 内容 --->
                            <div id="tdForm">
                                <table border="0" cellpadding="0" cellspacing="1" width="100%" class="idt_fim_mg">
                                    <tr>
                                        <td class="fim_l" width="15%">
                                           获奖类型</td>
                                         <td class="fim_r" width="35%">
	                                         <select name="resultType" style="width:100%">
	                                            <option value=""></option>
	                                            <%if(nameList != null && nameList.size()>0){ 
	                                                 for(int i =0;i<nameList.size();i++){
	                                                	 Map mm = (Map)nameList.get(i);
	                                                	 out.print("<option value=");
	                                                	 out.print(mm.get("NAME")+">");
	                                                	 out.print(mm.get("NAME"));
	                                                	 out.print("</option>");
	                                                 } 
	                                            
	                                            }%>
	                                         </select>
                                        </td> 
                                        <td class="fim_l" width="15%">
                                           获奖等级</td>
                                         <td class="fim_r" width="35%">
	                                         <select name="resultGrade" style="width:100%">
	                                            <option value=""></option>
	                                            <%if(levelList != null && levelList.size()>0){ 
	                                                 for(int i =0;i<levelList.size();i++){
	                                                	 Map mm = (Map)levelList.get(i);
	                                                	 out.print("<option value=");
	                                                	 out.print(mm.get("NAME")+">");
	                                                	 out.print(mm.get("NAME"));
	                                                	 out.print("</option>");
	                                                 } 
	                                            
	                                            }%>
	                                         </select>
                                        </td> 
                                    </tr> 
                                    <tr>
                                        <td class="fim_l" width="15%">
                                           获奖级别</td>
                                        <td class="fim_r" width="35%">
	                                        <select name="resultLevel" style="width:100%">
	                                          <option value=""></option>
	                                            <%if(gradeList != null && gradeList.size()>0){ 
	                                                 for(int i =0;i<gradeList.size();i++){
	                                                	 Map mm = (Map)gradeList.get(i);
	                                                	 out.print("<option value=");
	                                                	 out.print(mm.get("NAME")+">");
	                                                	 out.print(mm.get("NAME"));
	                                                	 out.print("</option>");
	                                                 } 
	                                            
	                                            }%>
	                                         </select>
                                        </td>
                                         <td class="fim_l" width="15%">
                                           获奖年份</td>
                                        <td class="fim_r" >
	                                      <input type="text" class="Wdate" id="belongyear" value="" style="width:99%" name="belongyear"   onFocus="WdatePicker({el:'belongyear',dateFmt:'yyyy'})" /></td> 
                                    </tr> 
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
                                    <tr>
                                        <td align="right">
                                            <input type="button" value="保存"   class="com_btn2"   onclick="addCup()" />
                                 <input type="button" value="关闭"   class="com_btn2"   onclick="window.close();" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                </table>
      </form>
</body>
</html>
